<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>Conv | 455のblog</title>
  <meta name="keywords" content=" Conv , ONNX ">
  <meta name="description" content="Conv | 455のblog">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="description" content="为什么需要激活函数？神经网络的每一个神经元的工作流程可以总结为下图：  数学表达：  那么为什么需要激活函数？ 从上图可以看出，神经网络中每一层的输入输出其实都是一个线性求和的过程，下一层的输出只是承接了上一层输入函数的线性变换，所以如果没有激活函数，那么无论你构造的神经网络多么复杂，有多少层，最后的输出都是输入的线性组合，纯粹的线性组合并不能够解决更为复杂的问题。激活函数可以向神经网络中引入非线">
<meta property="og:type" content="article">
<meta property="og:title" content="激活函数">
<meta property="og:url" content="http://example.com/2022/07/10/%E6%BF%80%E6%B4%BB%E5%87%BD%E6%95%B0/index.html">
<meta property="og:site_name" content="455のblog">
<meta property="og:description" content="为什么需要激活函数？神经网络的每一个神经元的工作流程可以总结为下图：  数学表达：  那么为什么需要激活函数？ 从上图可以看出，神经网络中每一层的输入输出其实都是一个线性求和的过程，下一层的输出只是承接了上一层输入函数的线性变换，所以如果没有激活函数，那么无论你构造的神经网络多么复杂，有多少层，最后的输出都是输入的线性组合，纯粹的线性组合并不能够解决更为复杂的问题。激活函数可以向神经网络中引入非线">
<meta property="og:locale" content="en_US">
<meta property="og:image" content="http://example.com/img/Activate/1.jpg">
<meta property="og:image" content="http://example.com/img/Activate/2.jpg">
<meta property="og:image" content="http://example.com/img/Activate/3.jpg">
<meta property="og:image" content="http://example.com/img/Activate/4.jpg">
<meta property="article:published_time" content="2022-07-10T08:41:09.000Z">
<meta property="article:modified_time" content="2022-07-17T07:15:59.379Z">
<meta property="article:author" content="Jilei Hou">
<meta property="article:tag" content="ONNX">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="http://example.com/img/Activate/1.jpg">


<link rel="icon" href="/img/IMG_1649.JPG">

<link href="/css/style.css?v=1.1.0" rel="stylesheet">

<link href="/css/hl_theme/github.css?v=1.1.0" rel="stylesheet">

<link href="//cdn.jsdelivr.net/npm/animate.css@4.1.0/animate.min.css" rel="stylesheet">

<script src="//cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.min.js"></script>
<script src="/js/titleTip.js?v=1.1.0" ></script>

<script src="//cdn.jsdelivr.net/npm/highlightjs@9.16.2/highlight.pack.min.js"></script>
<script>
    hljs.initHighlightingOnLoad();
</script>

<script src="//cdn.jsdelivr.net/npm/nprogress@0.2.0/nprogress.min.js"></script>



<script src="//cdn.jsdelivr.net/npm/jquery.cookie@1.4.1/jquery.cookie.min.js" ></script>

<script src="/js/iconfont.js?v=1.1.0" ></script>

<meta name="generator" content="Hexo 6.2.0"></head>
<div style="display: none">
  <input class="theme_disqus_on" value="false">
  <input class="theme_preload_comment" value="">
  <input class="theme_blog_path" value="">
  <input id="theme_shortcut" value="true" />
  <input id="theme_highlight_on" value="true" />
  <input id="theme_code_copy" value="true" />
</div>



<body>
<aside class="nav">
    <div class="nav-left">
        <a href="/"
   class="avatar_target">
    <img class="avatar"
         src="/img/IMG_1649.JPG"/>
</a>
<div class="author">
    <span>Jilei Hou</span>
</div>

<div class="icon">
    
        
            <a title="github"
               href="https://github.com/Jilei-Hou"
               target="_blank">
                
                    <svg class="iconfont-svg" aria-hidden="true">
                        <use xlink:href="#icon-github"></use>
                    </svg>
                
            </a>
        
    
        
            <a title="email"
               href="mailto:houjilei455@qq.com"
               target="_blank">
                
                    <svg class="iconfont-svg" aria-hidden="true">
                        <use xlink:href="#icon-email"></use>
                    </svg>
                
            </a>
        
    
        
            <a title="qq"
               href="http://wpa.qq.com/msgrd?v=3&uin=305509299&site=qq&menu=yes"
               target="_blank">
                
                    <svg class="iconfont-svg" aria-hidden="true">
                        <use xlink:href="#icon-qq"></use>
                    </svg>
                
            </a>
        
    
</div>




<ul>
    <li>
        <div class="all active" data-rel="All">All
            
                <small>(6)</small>
            
        </div>
    </li>
    
        
            
                <li>
                    <div data-rel="好玩的技术">
                        
                        好玩的技术
                        <small>(1)</small>
                        
                    </div>
                    
                </li>
            
        
    
        
            
                <li>
                    <div data-rel="论文分享">
                        
                        论文分享
                        <small>(1)</small>
                        
                    </div>
                    
                </li>
            
        
    
        
            
                <li>
                    <div data-rel="模型量化">
                        <i class="fold iconfont icon-right"></i>
                        
                        模型量化
                        <small>(4)</small>
                        
                    </div>
                    
                        <ul class="sub hide">
                            
                                <li>
                                    <div data-rel="模型量化<--->算子">
                                        
                                        算子
                                        
                                            <small>(3
                                                )</small>
                                        
                                    </div>
                                    
                                </li>
                            
                        </ul>
                    
                </li>
            
        
    
        
            
        
    
</ul>
<div class="left-bottom">
    <div class="menus">
        
            
            
            
    </div>
    <div>
        
        
    </div>
</div>
<input type="hidden" id="yelog_site_posts_number" value="6">
<input type="hidden" id="yelog_site_word_count" value="6.6k">
<div style="display: none">
    <span id="busuanzi_value_site_uv"></span>
    <span id="busuanzi_value_site_pv"></span>
</div>

    </div>
    <div class="nav-right">
        <div class="friends-area">
    <div class="friends-title">
        Links
        <i class="iconfont icon-left"></i>
    </div>
    <div class="friends-content">
        <ul>
            
            <li><a target="_blank" href="http://yelog.org/">叶落阁</a></li>
            
        </ul>
    </div>
</div>
        <div class="title-list">
    <div class="right-top">
        <div id="default-panel">
            <i class="iconfont icon-search" data-title="搜索 快捷键 i"></i>
            <div class="right-title">All</div>
            <i class="iconfont icon-file-tree" data-title="切换到大纲视图 快捷键 w"></i>
        </div>
        <div id="search-panel">
            <i class="iconfont icon-left" data-title="返回"></i>
            <input id="local-search-input" autocomplete="off"/>
            <label class="border-line" for="input"></label>
            <i class="iconfont icon-case-sensitive" data-title="大小写敏感"></i>
            <i class="iconfont icon-tag" data-title="标签"></i>
        </div>
        <div id="outline-panel" style="display: none">
            <div class="right-title">大纲</div>
            <i class="iconfont icon-list" data-title="切换到文章列表"></i>
        </div>
    </div>

    <div class="tags-list">
    <input id="tag-search" />
    <div class="tag-wrapper">
        
            <li class="article-tag-list-item">
                <i class="iconfont icon-tag"></i><a>代码生成</a>
            </li>
        
            <li class="article-tag-list-item">
                <i class="iconfont icon-tag"></i><a>模型量化</a>
            </li>
        
            <li class="article-tag-list-item">
                <i class="iconfont icon-tag"></i><a>自然语言处理</a>
            </li>
        
            <li class="article-tag-list-item">
                <i class="iconfont icon-tag"></i><a>Conv</a>
            </li>
        
            <li class="article-tag-list-item">
                <i class="iconfont icon-tag"></i><a>GitHub</a>
            </li>
        
            <li class="article-tag-list-item">
                <i class="iconfont icon-tag"></i><a>GPT</a>
            </li>
        
            <li class="article-tag-list-item">
                <i class="iconfont icon-tag"></i><a>Hexo</a>
            </li>
        
            <li class="article-tag-list-item">
                <i class="iconfont icon-tag"></i><a>ONNX</a>
            </li>
        
            <li class="article-tag-list-item">
                <i class="iconfont icon-tag"></i><a>PTQ</a>
            </li>
        
            <li class="article-tag-list-item">
                <i class="iconfont icon-tag"></i><a>QAT</a>
            </li>
        
    </div>

</div>

    
    <nav id="title-list-nav">
        
        <a  class="All 模型量化 算子 "
           href="/2022/07/10/%E6%BF%80%E6%B4%BB%E5%87%BD%E6%95%B0/"
           data-tag="ONNX"
           data-author="" >
            <span class="post-title" title="激活函数">激活函数</span>
            <span class="post-date" title="2022-07-10 16:41:09">2022/07/10</span>
        </a>
        
        <a  class="All 模型量化 算子 "
           href="/2022/07/09/Conv/"
           data-tag="Conv,ONNX"
           data-author="" >
            <span class="post-title" title="Conv">Conv</span>
            <span class="post-date" title="2022-07-09 14:26:09">2022/07/09</span>
        </a>
        
        <a  class="All 模型量化 "
           href="/2022/06/18/%E6%A8%A1%E5%9E%8B%E9%87%8F%E5%8C%96/"
           data-tag="模型量化,PTQ,QAT"
           data-author="" >
            <span class="post-title" title="模型量化">模型量化</span>
            <span class="post-date" title="2022-06-18 15:13:55">2022/06/18</span>
        </a>
        
        <a  class="All 模型量化 算子 "
           href="/2022/06/12/Conv_Gemm_MatMul%E4%B9%8B%E9%97%B4%E7%9A%84%E8%81%94%E7%B3%BB/"
           data-tag="Conv,ONNX"
           data-author="" >
            <span class="post-title" title="Conv Gemm MatMul之间的联系">Conv Gemm MatMul之间的联系</span>
            <span class="post-date" title="2022-06-12 14:35:00">2022/06/12</span>
        </a>
        
        <a  class="All 好玩的技术 "
           href="/2022/06/11/Hexo+GitHub/"
           data-tag="Hexo,GitHub"
           data-author="" >
            <span class="post-title" title="Hexo+GitHub搭建属于你的博客">Hexo+GitHub搭建属于你的博客</span>
            <span class="post-date" title="2022-06-11 16:55:00">2022/06/11</span>
        </a>
        
        <a  class="All 论文分享 "
           href="/2022/06/11/Codex/"
           data-tag="自然语言处理,GPT,代码生成"
           data-author="" >
            <span class="post-title" title="Codex">Codex</span>
            <span class="post-date" title="2022-06-11 16:38:00">2022/06/11</span>
        </a>
        
        <div id="no-item-tips">

        </div>
    </nav>
    <div id="outline-list">
    </div>
</div>

    </div>
    <div class="hide-list">
        <div class="semicircle" data-title="切换全屏 快捷键 s">
            <div class="brackets first"><</div>
            <div class="brackets">&gt;</div>
        </div>
    </div>
</aside>
<div id="post">
    <div class="pjax">
        <article id="post-Conv" class="article article-type-post" itemscope itemprop="blogPost">
    
        <h1 class="article-title">Conv</h1>
    
    <div class="article-meta">
        
        
        
        <span class="book">
            <i class="iconfont icon-category"></i>
            
            
            <a  data-rel="模型量化">模型量化</a> > 
            
            <a  data-rel="模型量化&lt;---&gt;算子">算子</a>
            
        </span>
        
        
        <span class="tag">
            <i class="iconfont icon-tag"></i>
            
            <a class="color5">Conv</a>
            
            <a class="color5">ONNX</a>
            
        </span>
        
    </div>
    <div class="article-meta">
        
            Created At : <time class="date" title='Updated At: 2022-07-09 15:43:18'>2022-07-09 14:26</time>
        
    </div>
    <div class="article-meta">
        
        <span>Count:318</span>
        
        
        <span id="busuanzi_container_page_pv">
            Views 👀 :<span id="busuanzi_value_page_pv">
                <span class="count-comment">
                    <span class="spinner">
                      <div class="cube1"></div>
                      <div class="cube2"></div>
                    </span>
                </span>
            </span>
        </span>
        
        
    </div>
    
    <div class="toc-ref">
    
        <ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#%E4%BB%80%E4%B9%88%E5%8D%B7%E7%A7%AF%EF%BC%9F"><span class="toc-text">什么卷积？</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E8%BE%93%E5%85%A5%E8%BE%93%E5%87%BA%E5%92%8C%E5%8D%B7%E7%A7%AF%E6%A0%B8%E3%80%81%E6%AD%A5%E9%95%BF%E3%80%81%E5%A1%AB%E5%85%85%E9%97%B4%E7%9A%84%E5%85%B3%E7%B3%BB"><span class="toc-text">输入输出和卷积核、步长、填充间的关系</span></a></li></ol></li><li class="toc-item toc-level-1"><a class="toc-link" href="#%E5%8F%82%E8%80%83%E8%B5%84%E6%96%99"><span class="toc-text">参考资料</span></a></li></ol>
    
<style>
    .left-col .switch-btn,
    .left-col .switch-area {
        display: none;
    }
    .toc-level-6 i,
    .toc-level-6 ol {
        display: none !important;
    }
</style>
</div>
    
    <div class="article-entry" itemprop="articleBody">
      
        <p>卷积作为深度学习的基础概念，入门深度学习，不可能绕过卷积。但你真的了解各种卷积吗？</p>
<p>2D &#x2F; 3D &#x2F; 1x1 &#x2F;转置&#x2F;扩张（Atrous）&#x2F;空间可分&#x2F;深度可分&#x2F;平展&#x2F;分组&#x2F;混洗分组卷积</p>
<h1 id="什么卷积？"><a href="#什么卷积？" class="headerlink" title="什么卷积？"></a>什么卷积？</h1><p><img src="/2022/07/09/Conv/Users\HJL\Desktop\Hexo\source\img\Conv\R-C.gif"></p>
<p>卷积的过程如上图，简单来说，卷积其实就是通过某个卷积核不断地与输入进行内积，得到输出。</p>
<p>其中涉及到很多其他问题：</p>
<ol>
<li>卷积核（kernel）：用于对输入进行共享权值的遍历，上图中每次阴影部分3*3都会与卷积核内积</li>
<li>步长（stride）：即每次内积后移动的幅度</li>
<li>填充（padding）：为了保持输出的尺寸，需要在输入图像进行上填充，使用padding后的输出 &#x3D; padding前的输出+2*padding</li>
</ol>
<h2 id="输入输出和卷积核、步长、填充间的关系"><a href="#输入输出和卷积核、步长、填充间的关系" class="headerlink" title="输入输出和卷积核、步长、填充间的关系"></a>输入输出和卷积核、步长、填充间的关系</h2><p>假设输入为C*H*W，padding &#x3D; p，kernel size为k*k，步长为s</p>
<p>输出：C*H<sub>out</sub>*W<sub>out</sub></p>
<p>每个维度单独卷积，维度不会变，还是C</p>
<p>H<sub>out</sub> &#x3D; (H + 2*p - k)&#x2F;s + 1</p>
<p>W<sub>out</sub> &#x3D; (W + 2*p - k)&#x2F;s + 1</p>
<h1 id="参考资料"><a href="#参考资料" class="headerlink" title="参考资料"></a>参考资料</h1><p><a target="_blank" rel="noopener" href="https://zhuanlan.zhihu.com/p/57575810">卷积有多少种？一文读懂深度学习中的各种卷积 - 知乎 (zhihu.com)</a></p>

      
       <hr><span style="font-style: italic;color: gray;"> 转载请注明来源，欢迎对文章中的引用来源进行考证，欢迎指出任何有错误或不够清晰的表达。可以在下面评论区评论，也可以邮件至houjilei455@qq.com </span>
    </div>
</article>







    




    </div>
    <div class="copyright">
        <p class="footer-entry">
    ©2022-2022 455のblog
</p>
<p class="footer-entry">Built with <a href="https://hexo.io/" target="_blank">Hexo</a> and <a href="https://github.com/yelog/hexo-theme-3-hexo" target="_blank">3-hexo</a> theme</p>

    </div>
    <div class="full-toc">
        <button class="full" data-title="切换全屏 快捷键 s"><span class="min "></span></button>
<a class="" id="rocket" ></a>

    </div>
</div>

</body>
<script src="/js/jquery.pjax.js?v=1.1.0" ></script>

<script src="/js/script.js?v=1.1.0" ></script>
<script>
    var img_resize = 'default';
    function initArticle() {
        /*渲染对应的表格样式*/
        

        /*渲染打赏样式*/
        

        /*高亮代码块行号*/
        

        /*访问数量*/
        
        $.getScript("//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js");
        

        /*代码高亮，行号对齐*/
        $('.pre-numbering').css('line-height',$('.has-numbering').css('line-height'));

        
        
    }

    /*打赏页面隐藏与展示*/
    

</script>

<!--加入行号的高亮代码块样式-->

<!--自定义样式设置-->
<style>
    
    
    .nav {
        width: 562px;
    }
    .nav.fullscreen {
        margin-left: -562px;
    }
    .nav-left {
        width: 140px;
    }
    
    
    @media screen and (max-width: 1468px) {
        .nav {
            width: 512px;
        }
        .nav.fullscreen {
            margin-left: -512px;
        }
        .nav-left {
            width: 120px;
        }
    }
    
    
    @media screen and (max-width: 1024px) {
        .nav {
            width: 512px;
            margin-left: -512px
        }
        .nav.fullscreen {
            margin-left: 0;
        }
    }
    
    @media screen and (max-width: 426px) {
        .nav {
            width: 100%;
        }
        .nav-left {
            width: 100%;
        }
    }
    
    
    .nav-right .title-list nav a .post-title, .nav-right .title-list #local-search-result a .post-title {
        color: #383636;
    }
    
    
    .nav-right .title-list nav a .post-date, .nav-right .title-list #local-search-result a .post-date {
        color: #5e5e5f;
    }
    
    
    .nav-right nav a.hover, #local-search-result a.hover{
        background-color: #e2e0e0;
    }
    
    

    /*列表样式*/
    

    /* 背景图样式 */
    
    


    /*引用块样式*/
    

    /*文章列表背景图*/
    

    
    #post .pjax article :not(pre) > code {
        color: #24292e;
        font-family: SFMono-Regular,Consolas,Liberation Mono,Menlo,Courier,monospace;
        background-color: rgba(27,31,35,.05);
        border-radius: 3px;
        font-size: 85%;
        margin: 0;
        padding: .2em .4em;
    }
    
</style>







</html>
